package com.tanhua.server.controller;

import com.tanhua.server.interceptor.UserHolder;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.Map;

/**
 * @author liuyp
 * @date 2021/02/04
 */
@RestController
@RequestMapping("/huanxin")
public class HuanXinController {

    /**
     * 获取用户的环信id和密码
     * GET /huanxin/user
     */
    @GetMapping("/user")
    public ResponseEntity getHuanxinUser(){
        Map<String, Object> result = new HashMap<>();
        result.put("username", UserHolder.getUserId().toString());
        result.put("password", "123456");
        return ResponseEntity.ok(result);
    }
}
